b2b = {};

b2b.Task = function() {
};

b2b.Task.prototype.findIndex = function(inputString, s) {
    notFound = -1;

    if ((s.length > inputString.length) || (s.length == 0)) {
        return notFound;
    }

    k = 0; // index of a char in the 'inputString'
    while (inputString.length - k >= s.length) {
        m = k; // start searching from k(th) char of the 'inputString'
        l = 0; // index of a char in the 's'
        while ((inputString[m] == s[l]) && (l < s.length)) {
            if (l == (s.length - 1)) {
                return k;
            }
            l++;
            m++;
        }
        k++;
    }
    return notFound;
};
